# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-airium
pkgver=0.2.3
pkgrel=0
pkgdesc="Bidirectional HTML to Python Translator"
url="https://gitlab.com/kamichal/airium"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools"
checkdepends="pytest"
source="https://gitlab.com/kamichal/airium/-/archive/v$pkgver/airium-v$pkgver.tar.gz
	exclude-tests.patch"
builddir="$srcdir/airium-v$pkgver/"

build() {
	python3 setup.py build
}

check() {
	# test_backward appears to be broken
	# tests omitted from test_main_entry require network usage
	# test_dependencies_message requires the package to be installed
	pytest \
		--ignore tests/test_translation.py \
		--deselect tests/test_boiler_hello.py::test_backward \
		--deselect tests/test_main_entry.py::test_get_bad_content_type \
		--deselect tests/test_main_entry.py::test_translate_local_file \
		--deselect tests/test_main_entry.py::test_translate_remote_file \
		--deselect tests/test_when_no_deps.py::test_dependencies_message
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
2aa504fe899a8aead7674dc734688911d2d380df71d2f0413b89a70810ad557543e24a1f0268fc0d5829e70b0e88d08330239e4599fb9955953999d77f770fdb  airium-v0.2.3.tar.gz
493bd3d65bf34b80b149b95a4e449af7b2fd15b5500041ded3e44d4e19a9d0f82e10a139cde80119c516c81a4951d3d55eaa8fefb731d19a72a3595b8f517f99  exclude-tests.patch
"
